<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	if (session.getAttribute("email") != null
			&& session.getAttribute("token") != null) {
		response.sendRedirect(basePath + "homepage.jsp");
	} else {
		// Set to expire far in the past.
		response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");

		// Set standard HTTP/1.1 no-cache headers.
		response.setHeader("Cache-Control",
				"no-store, no-cache, must-revalidate");

		// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
		response
				.addHeader("Cache-Control", "post-check=0, pre-check=0");

		// Set standard HTTP/1.0 no-cache header.
		response.setHeader("Pragma", "no-cache");
	}
%>

<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>EIA Project 1 Login Page</title>
		<link rel="stylesheet"
			href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
		<link rel="stylesheet" type="text/css" href="css/template.css" />
		<link rel="canonical"
			href="http://www.alessioatzeni.com/wp-content/tutorials/jquery/login-box-modal-dialog-window/index.html" />
		<link rel="stylesheet" href="/resources/demos/style.css" />
		<script type="text/javascript"
			src="http://code.jquery.com/jquery-1.9.1.js"></script>
		<script type="text/javascript"
			src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
		<script type="text/javascript" src="jquery/template.js"></script>


	</head>

	<body>
<input type="hidden" name="projectName" id="projectName" value="<%=basePath %>"/>
<h1><br>Welcome to our site<small>  This is implemented by Josh & Tony | 
<a href="http://www.unimelb.edu.au/"> Have a nice day! </a></small></h1>
<div class="container">
  <div id="content">
    
    <div class="post">
      <h2><br><br>Please click the following button to login or register</h2>
          <div class="btn-sign">
        <a href="#login-box" class="login-window">Login / Register </a>
          </div>
    </div>
        
        <div id="login-box" class="login-popup">
        <a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
        <div class="signin">
                <fieldset class="textbox">
              <label class="username">
              <br>
                <span>Username or email</span> <span id = "test_login_e" style = "width:100px; color: red; display:none">   Invalid</span><br>
                <input class = "email" id="username_login" name="email" value="" type="text" autocomplete="on" placeholder="Username">
                
                </label>
                
                <label class="password">
                <span>Password</span><span id = "test_login_p" style = "width:100px; color: red; display:inline">  cannot be empty </span>
                <input class = "password" id="password" name="password" value="" type="password" placeholder="Password">
                </label>
                
                <button class="submit" name= "servlet/Login" id = "login" disabled="disabled">Login</button>
                <p id = "message-login" class = "message" style = "color: red; display:none"></p>
                
                
                <div>
                <br>
                <!--<div class="btn-sign">
        -->
        <a href="#Forgot-box" class="forgot-window">Forgot your password? </a>
            </div>
            
            
                <!--
                
                <div class="btn-sign">
                -->
                <div>
                
        <a href="#Register-box" class="register-window">Register now! </a>
            </div>
            
                
                </fieldset>
      </div>
    </div>
    
    <div id="Register-box" class="login-popup">
              <a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
              <div class="signin">  
                  <fieldset class="textbox">
                <label class="username">
                  <span>Username or email</span><span id = "test_register" style = "width:100px; color: red; display:none">   Invalid</span><br>
                  <input class = "email" id="username_register" name="email" value="" type="text" autocomplete="on" placeholder="Username">
                  
                  </label>                
                  <button class="submit" name= "servlet/Register" id="register" disabled="disabled">Register</button>
                  <p id = "message-register" class = "message" style = "color: red; display:none"></p>
              </fieldset>
          </div>
        </div>
    
    <div id="Forgot-box" class="login-popup">
              <a href="#" class="close"><img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
              <div class="signin">
                  <fieldset class="textbox">
                <label class="username">
                  <span>Username or email</span><span id = "test_remind" style = "width:100px; color: red; display:none">   Invalid</span><br>
                  <input class = "email" id="username_remind" name="email" value="" type="text" autocomplete="on" placeholder="Username">
                  
                  </label>                
                  <button class="submit" name= "servlet/Reminder" id="remind" disabled="disabled">Remind me</button>
                  <p id = "message-forgot" class = "message" style = "color: red; display:none"></p>
              </fieldset>
         </div>
        </div>
    
    </div>
</div>

</body>
</html>
